package com.tutorialspoint.annotation;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Required;

public class Student {
	private Integer age;
	private String name;
	private Sex sex;
	private HelloWorld hello;
	@Required
	public void setAge(Integer age) {
		this.age = age;
	}
	public Integer getAge() {
		return age;
	}
	@Required
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	@Autowired
	@Qualifier("sex1")
	public void setSex(Sex sex) {
		this.sex = sex;
	}
	public String getSex() {
		return sex.getSex();
	}
	@Resource(name="helloWorld123")
	public void setAction(HelloWorld hw) {
		hello = hw;
	}
	public String sayHello() {
		return hello.getMessage();
	}
}
